#pragma once

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned long u32;
typedef const unsigned char cu8;
typedef const unsigned short cu16;
typedef const unsigned long cu32;

class SColor
{
public:
	u8 r;
	u8 g;
	u8 b;
	u8 a;

	SColor():r(0x00), g(0x00), b(0x00), a(0xff){}
	SColor(cu8 r, cu8 g, cu8 b, cu8 a):r(r), g(g), b(b), a(a){}
	~SColor(){};
	void set(cu8 r, cu8 g, cu8 b, cu8 a){this->r = r; this->g = g; this->b = b; this->a = a;}

	unsigned long getInt(){return *((u32*)&r);}
	unsigned int* getIntAddr(){return (u32*)&r;}
	unsigned char* getByteAddr(){return &r;}
	SColor& operator= (const SColor& c)
	{
		*((u32*)&r) = *((u32*)&c.r);
		return *this;
	}
	SColor& operator= (cu32& i)
	{
		*((u32*)&r) = i;
		return *this;
	}
	void set(const DWORD i){*((DWORD*)&r) = i;}
};